Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse notable addresses for Swift Assertion failure messages #188

Merged
merged 6 commits into from
Oct 12, 2017

Conversation

fractalwrench
Copy link
Contributor

Enables memory introspection in KSCrash, which allows us to parse the notable addresses for Swift Assertion failure messages, as requested in #159. The message should now be captured for fatalError, preconditionFailure, assertionFailure, and assert.

This approach relies on heuristics - we'll inspect the variable values, and set the error message in the following conditions:

  • "fatal error" or "assertion failure" is present in at least one variable
  • At least one variable is a string that contains 2 or less "/"

If this isn't the case, we won't alter the error message.

@@ -24,7 +24,7 @@ - (void)install:(BugsnagConfiguration *)config
BugsnagSink *sink = [[BugsnagSink alloc] initWithApiClient:apiClient];
[BSG_KSCrash sharedInstance].sink = sink;
// We don't use this feature yet, so we turn it off
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should change/remove the comment here

addresses[@"r24"] = @{
@"address": @4511084983,
@"type": @"string",
@"value": @"/usr/include/lib/something.swift"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value in including these addresses in other metadata?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quite possibly - I'll look into what sort of values are available for our Swift/Obj-C examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants